//
//  HZAddButton.swift
//  weibo002
//
//  Created by 黑眼圈 on 16/4/25.
//  Copyright © 2016年 heiyan. All rights reserved.
//

import UIKit

class HZAddButton: UIButton {
    
    
    //重写高亮的属性,让按钮没有高亮状态
    override var highlighted:Bool {
        
        get{
            return false
        }
        set{
            
            
        }
    }



    override init(frame: CGRect) {
        super.init(frame: frame)
        
        
        setupUI()
    }
    
    

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    
    
    private func setupUI(){
        
       titleLabel?.textAlignment = .Center
        imageView?.contentMode = .Center
        
      
    
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        // 调整 imageView 的宽高
        self.imageView?.frame = CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.width)
        
        // 调整label
        self.titleLabel?.frame = CGRect(x: 0, y: self.frame.width, width: self.frame.width, height: self.frame.height - self.frame.width)
        
    }
    
    
  
    
    
    
    
    
    
    
    
}
